package com.dynamic.sync.toolkit.mongo.sync.request;

import com.dynamic.sync.toolkit.EnvType;
import org.apache.commons.lang3.StringUtils;

/**
 * @author ZonLen since on 2021/6/19 下午10:01
 */
public class SyncFromPreReq extends SyncFromEnvReq{

  @Override
  public EnvType targetEnv() {
    if (StringUtils.isBlank(getTargetEnv())) {
      throw new RuntimeException("环境参数有问题");
    }
    final EnvType envType = EnvType.valueOf(getTargetEnv());
    if (envType == EnvType.pre) {
      throw new RuntimeException("环境参数有问题");
    }
    return envType;
  }

}
